<!--{Atemplate tpl/header}-->

<!--{eval echo $this->Ahtml_js_aurl();}-->
<!--{Atemplate customer/area}-->
<script>
var columns = {"$this->model->table":$column_json};
var url_info = "$this->Amodr-info-";
var model = $listjson;
function checkall(value) {
	if(value=='0'){
		jQuery(".checkbox").attr("checked","checked");
		jQuery("#chkall_del").removeAttr("disabled","disabled");
	}
	if(value=='1'){
		jQuery(".checkbox").removeAttr("checked","checked");
		jQuery("#chkall_del").attr("disabled","disabled");
	}
	if(value=='auth'){
		var chkall = jQuery("input:checked").val();
		if(chkall == null){
			alert('请先选择');
			return false;
		}else{
			return true;
		}
	}
}
var Aform = new Apps.form('customer','Aform',{'add':{width:640,height:'auto'}},columns.$this->model->table,{info:'$this->Amodr-info-',save:'$this->Amodr-save-one'});

jQuery(function(){
	jQuery(".checkbox").change(function (){
		if(jQuery("input:checked").val()){
			jQuery("#chkall_del").removeAttr("disabled","disabled");
		}else{
			jQuery("#chkall_del").attr("disabled","disabled");
		}
	});
})
</script>
<form action="crm-customer-pool_add-referrer" method="POST">
<div class="_crmtop _pooltop">
	<!--{if ($page->counts==1 && empty($list[0]->username))}-->
		<input type="hidden" name="save[]" value="$list[0]->cid"/>
		<input type="submit" value="添加为我的客户"/>
	<!--{/if}-->
</div>
</form>
<div class="-main_list _customer_my">
<table class="-table _width">
	<tr class="th">
		<th><b>员工</b></th>
	<!--{loop $column $key $val}-->
		<th><b><a href="$page->theurl-aorder-$key,$pages->neworder$pages->other">$val</a></b></th>
	<!--{/loop}-->
	</tr>
<!--{loop $list $key $val}-->
<!--{eval
$mid = $val->$key_name;
}-->
	<tr class="_tr" id="$mid">
		<td><!--{if !empty($val->username)}-->$val->username<!--{else}-->客户池<!--{/if}--></td>
		<!--{eval echo $obj->for_html($key,$val,$column,$this->model);}-->
	</tr>
<!--{/loop}-->
</table>
</div>
<div class="_crmnav">
	<span class="_info">客户条数：$page->counts</span>
	<div class="_page">
		$pages->html
		<!--<input type="number" size="8">
		<input type="button" value="跳转">-->
	</div>
</div>
<!--{Atemplate tpl/nofooter}-->